package aar.test.tessocr;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import aar.test.tessocr.baseApplication.BaseApplication;
import clx.tessocr.ocreng.R;
import okgo.OkGo;

public class LogInfoActivity extends AppCompatActivity {

    private LinearLayout user_scan,user_cab,user_setting,user_date;

    private TextView user_name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_long_info);
        initView();
    }

    private void initView(){

        user_name=findViewById(R.id.user_name);

        if(null!=BaseApplication.getIntance().getLoginBean()&&!TextUtils.isEmpty(BaseApplication.getIntance().getLoginBean().getUsername())){

            user_name.setText(BaseApplication.getIntance().getLoginBean().getUsername());
        }

        user_scan=findViewById(R.id.user_scan);

        user_scan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startActivity(new Intent(LogInfoActivity.this, ObtainModeActivity.class));



            }
        });

        user_cab=findViewById(R.id.user_cab);

        user_cab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startActivity(new Intent(LogInfoActivity.this, ChioceCabActivity.class));

            }
        });

        user_setting=findViewById(R.id.user_setting);

        user_setting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startActivity(new Intent(LogInfoActivity.this, SettingActivity.class));

            }
        });


        user_date=findViewById(R.id.user_date);

        user_date.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startActivity(new Intent(LogInfoActivity.this, AppointmentListActivity.class));

            }
        });

    }




    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时，取消网络请求
        OkGo.getInstance().cancelTag(this);




    }

}
